package com.sneakxy.cloudbase.platform.service;

import java.io.IOException;
import java.io.InputStream;

import org.csource.common.MyException;
import org.springframework.web.multipart.MultipartFile;

import com.sneakxy.cloudbase.platform.bean.UploadFile;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
public interface IUploadFileService extends IBaseService<UploadFile, String> {

	/**
	 * 获取表名
	 * @param id 文件ID
	 * @return
	 */
	public String getTableName(String id);
	
	/**
	 * 删除文件
	 * @param id
	 * @throws IOException 
	 * @throws MyException 
	 */
	public void remove(String id) throws IOException, MyException;
	
	/**
	 * 保存到fastdfs
	 * @param file
	 * @return
	 * @throws IOException
	 * @throws MyException
	 */
	public String storeToFastDfs(MultipartFile file) throws IOException, MyException;
	
	/**
	 * 保存到fastdfs
	 * @param is
	 * @param size
	 * @return
	 * @throws IOException
	 * @throws MyException
	 */
	public String storeToFastDfs(InputStream is, int size) throws IOException, MyException;
	
	/**
	 * 保存到ftp
	 * @param file
	 * @param account
	 * @return
	 * @throws IOException 
	 */
	public String storeToFtp(MultipartFile file, String account) throws IOException;
	
	/**
	 * 保存到ftp
	 * @param is
	 * @param account
	 * @return
	 * @throws IOException 
	 */
	public String storeToFtp(InputStream is, String account) throws IOException;
	
	/**
	 * 保存到本地
	 * @param file
	 * @param account
	 * @return
	 * @throws IOException
	 */
	public String storeToLocal(MultipartFile file, String account) throws IOException;
	
	/**
	 * 保存到本地
	 * @param is
	 * @param account
	 * @return
	 * @throws IOException
	 */
	public String storeToLocal(InputStream is, String account) throws IOException;
	
}
